<?php

namespace app\admin\validate;

use think\Validate;
use app\common\Error;

class Video extends Validate
{
    protected $rule = [
        'id' => 'require',
        'video_type_id' => 'require',
        'name' => 'require',
        'cover_img' => 'require',
        'label' => 'require',
        'is_free' => 'require',
        'sylloge' => 'require',
        'is_shelves' => 'require',
        'synopsis' => 'require',
        'admin_uid' => 'require',
    ];

    protected $message = [
        'id.require' => Error::ID_NOT_EXIXTS,
        'video_type_id.require' => Error::VIDEO_TYPE_ID_NOT_EXIXTS,
        'name.require' => Error::NAME_NOT_EXIXTS,
        'cover_img.require' => Error::COVER_IMG_NOT_EXIXTS,
        'label.require' => Error::LABEL_NOT_EXIXTS,
        'is_free.require' => Error::IS_FREE_NOT_EXIXTS,
        'sylloge.require' => Error::SYLLOGE_NOT_EXIXTS,
        'is_shelves.require' => Error::IS_SHELVES_NOT_EXIXTS,
        'synopsis.require' => Error::SYNOPSIS_NOT_EXIXTS,
        'admin_uid.require' => Error::ADMIN_UID_NOT_EXIXTS,
    ];

    protected $scene = [
        'add' => [ 'name', 'cover_img', 'label', 'is_free', 'sylloge', 'is_shelves', 'synopsis'],
        'edit' => ['id', 'name', 'cover_img', 'label', 'is_free', 'sylloge', 'is_shelves', 'synopsis'],
        'delete' => ['id'],
        'detail' => ['id'],
        'shelve' => ['id'],
        'show' => ['id'],
        'recommend' => ['id'],
        'publisher_video_select_list' => ['admin_uid'],
    ];
}